AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include("shared.lua")

function ENT:Initialize()
	self.Entity:PhysicsInit( SOLID_VPHYSICS )
	self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
	self.Entity:SetSolid( SOLID_VPHYSICS )
	self.Entity:SetModel("models/props_combine/breentp_rings.mdl")
end

function ENT:Think()
self:SetOverlayText( "NRG left: " .. self.Rez )
if self.Rez <= 0 && self.Rez ~= -6999 then
self.Entity:Remove()
else

local entz = ents.FindInSphere(self.Entity:GetPos(),30)
  if WMPause == true then return end
	for k, v in pairs(entz) do
		if v:GetClass() == "lap_harvester"  && v:GetTable().Full == 0 then 
    v:GetTable().Full = 1
    if self.Rez ~= -6999 then
    self.Rez = self.Rez - server_settings.Int( "WM_RezPerHarvest", 2500)
    end
	  break;
		end
	end
end
	self.Entity:NextThink(CurTime()+1);
	return true
end